//
//  UIView+Gradient.h
//  EduOnLine
//
//  Created by Mac on 2019/11/14.
//  Copyright © 2019 eduonline. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM (NSUInteger,GradientOrientation) {
    GradientOrientationLeftToRight,
    GradientOrientationTopToBottom,
    GradientOrientationLeftTopToRightBottom,
    GradientOrientationLeftBottomToRightTop
};
@interface UIView (Gradient)

@property(nullable, copy) NSArray *colors;
@property(nullable, copy) NSArray<NSNumber *> *locations;
@property CGPoint startPoint;
@property CGPoint endPoint;

+ (UIView *_Nullable)gradientViewWithColors:(NSArray<UIColor *> *_Nullable)colors locations:(NSArray<NSNumber *> *_Nullable)locations startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint;

- (void)setGradientBackgroundWithColors:(NSArray<UIColor *> *_Nullable)colors locations:(NSArray<NSNumber *> *_Nullable)locations startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint;
- (void)setGradientBackgroundWithColors:(NSArray<UIColor *> *_Nullable)colors orientation:(GradientOrientation)orientation;
- (void)setGradientBackgroundWithColors:(NSArray<UIColor *> *_Nullable)colors orientation:(GradientOrientation)orientation locations:(NSArray<NSNumber *> *_Nullable)locations;
@end
NS_ASSUME_NONNULL_END
